#ifndef CIniFile_____
#define CIniFile_____

#include <vector>
using namespace std;

typedef struct
{
	CString sSectionName;
	unsigned int nNumKeys;
	vector< CString > vDataType;
	vector< CString > vKey;
	vector< CString > vValue;
} Section;

typedef struct
{
	unsigned int nNumTextures;
	vector< CString > sTexturePath;
	vector< float > fMinPct;
	vector< float > fMaxPct;
} Elevation;

class CIniFile
{
  public:

	//-------------------------------------------------------------------------
	// members
	//-------------------------------------------------------------------------

	CString m_sPath;
	unsigned int m_nSections;
	vector< Section > m_vSection;
	Elevation m_Elevation;

	//-------------------------------------------------------------------------
	// constructors
	//-------------------------------------------------------------------------

	CIniFile();
	CIniFile(CString sPath);

	//-------------------------------------------------------------------------
	// destructor
	//-------------------------------------------------------------------------

	~CIniFile();

	//-------------------------------------------------------------------------
	// overloaded operators
	//-------------------------------------------------------------------------

	//-------------------------------------------------------------------------
	// functions
	//-------------------------------------------------------------------------

	bool LoadIniFile();
	int ReadKey(CString sSection, CString sKey, float &fValue);
	int ReadKey(CString sSection, CString sKey, int &nValue);
	int WriteSection(CString sSection);
	int WriteKey(CString sKey, float &fValue);
	int WriteKey(CString sKey, int &nValue);
	void DeleteIfExists();

};

#endif
